package com.springcloudconfig.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRule {

    // IRule 是 Ribbon 负载均衡的根接口,它有很多实现类，负载均衡策略名就是这些实现类的名字
    @Bean
    public IRule rule(){
        return new RandomRule();
    }
}
